DiscoverThe iOS Dev DiaryBuilding a Day Counter on iOS – Part 3
Building a Day Counter on iOS – Part 3

Building a Day Counter on iOS – Part 3

Update: 2018-04-11
Share

Description

<iframe class="youtube-player" width="604" height="340" src="https://www.youtube.com/embed/qVGQXMeOcy0?version=3&rel=1&showsearch=0&showinfo=1&iv_load_policy=1&fs=1&hl=en-US&autohide=2&wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>


In this series I’ll show you how to create a simple Day Counter on iOS, using Objective-C and Xcode 9. The idea is to set a date in a settings screen, and then see how many days have elapsed on the main screen right after launching the app.


This is a 3-Part Mini-Series:



  • Part 1 is all about building the interface in Interface Builder

  • Part 2 is about coding the NSDate subtraction methods, using NSCalendar and loading/saving data using NSUserDefaults

  • Part 3 will introduce Key/Value Observing to update the first view controller as soon as the date is changed in the settings and deals with how to normalise an NSDate object.


You can find the full code on GitHub:



  • https://github.com/versluis/Day-Counter/


Happy Hacking!


Watch the full course in one convenient playlist:
Catch this episode on my iOS Dev Diary Podcast:

Comments 
loading
00:00
00:00
1.0x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Building a Day Counter on iOS – Part 3

Building a Day Counter on iOS – Part 3

Jay Versluis